<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/3/23 0023
 * Time: 下午 2:51
 */

namespace app\admin\model;


use think\Model;

class MusicModel extends Model
{
    protected $table = "music";

    /**
     * 获取所有状态为 1 的音乐
     * @return array
     */
    static public function getMusicAll()
    {
        $model = new self();
        $result = $model->where("status","=",1)
            ->field(["id","title"])
            ->order("create_time","DESC")
            ->select()
            ->toArray();
        return $result ?? [];
    }
}